//
//  Tool.m
//  随手做做
//
//  Created by wemax on 15/12/18.
//  Copyright © 2015年 wemax. All rights reserved.
//

#import "Tool.h"
#import "AFNetworking.h"
#import "AFHTTPRequestOperationManager.h"

#import "AFHTTPSessionManager.h"

@implementation Tool
+ (void)requestLOGString:(NSString *)urlStr withParameters:(NSMutableDictionary *)parameter successBlock:(void (^)(NSDictionary * dic))successBlock
{
    NSLog(@"Dictionary000000%@",parameter);
    AFHTTPRequestOperationManager * manager = [AFHTTPRequestOperationManager manager];
       manager.responseSerializer=[AFJSONResponseSerializer serializer];
      [manager POST:urlStr parameters:parameter success:^(AFHTTPRequestOperation *operation, id responseObject) {
          NSLog(@"🐷🐷%@",parameter);
          NSLog(@"🚗%@",responseObject);
          NSString *dicc=[responseObject objectForKey:@"Message"];
          NSLog(@"✈️%@",dicc);
        for (NSDictionary * dic in responseObject) {
            successBlock(dic);
        }
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        NSLog(@"失败%@",error);
    }];
}
@end
